<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.gfa4j.web.UserDetail"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<%@page import="java.util.Map"%>
<%@page import="com.wef.system.entity.Module"%>
<%@page import="com.gfa4j.web.SessionManager"%>
<%@page import="com.wef.common.service.UserInfo"%>

<%@include file="/pages/common/taglib.jsp" %>
<%@include file="/styles/stylelib.jsp"  %>
<%@include file="/scripts/sdk/js_lib.jsp"  %>
<%@include file="/scripts/utils/js_lib.jsp"  %>
<%@include file="/scripts/validate/js_lib.jsp"  %>

<html>
<% 
UserDetail userDetail = com.gfa4j.web.SessionManager.getUserDetail();
Map<String, Module> modules = (Map<String, Module>)UserInfo.getInstance().getUserModules();

if(userDetail != null&&modules.containsKey("system")){
String userName = userDetail.getUserCode();
String laguage = userDetail.getDefaultLang().toString();
%>
<head>
<title>系统管理</title>

<link rel="stylesheet" type="text/css" href="scripts/debug/widgets/ext-2.2.1/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="scripts/debug/widgets/ext-2.2.1/resources/ext-all-modify.css" />
<link rel="stylesheet" type="text/css" href="scripts/debug/widgets/ext-2.2.1/resources/css/gfa4ext-all.css" />
<link rel="stylesheet" type="text/css" href="styles/standard/icon.css" />

<script type="text/javascript">var App = {ctx:"${pageContext.request.contextPath}", lang:"${lang}"};</script>
<!-- 
<script type="text/javascript" src="dwr/engine.js"></script>
<script type="text/javascript" src="dwr/util.js"></script>
 -->
<script type="text/javascript" src="scripts/debug/sdk/dwr.js"></script>
<script type="text/javascript" src="dwr/interface/AuthFunctionService.js"></script>
<script type="text/javascript" src="dwr/interface/AclConfigEntryService.js"></script>
<script type="text/javascript" src="dwr/interface/AclPermissionService.js"></script>
<script type="text/javascript" src="dwr/interface/CommonService.js"></script>
<script type="text/javascript" src="dwr/interface/UserService.js"></script>
<script type="text/javascript" src="dwr/interface/ModuleService.js"></script>
<script type="text/javascript" src="dwr/interface/PrivilegeService.js"></script>
<script type="text/javascript" src="dwr/interface/LoginService.js"></script>
<script type="text/javascript" src="dwr/interface/RoleService.js"></script>
<script type="text/javascript" src="dwr/interface/OfficeService.js"></script>


<script type="text/javascript" src="scripts/debug/widgets/ext-2.2.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="scripts/debug/widgets/ext-2.2.1/ext-all-debug.js"></script>
<script type="text/javascript" src="scripts/debug/widgets/gfa4ext/widgets/dDView.js"></script>
<script type="text/javascript" src="scripts/debug/widgets/gfa4ext/widgets/itemSelector.js"></script>
<script type="text/javascript" src="scripts/debug/widgets/gfa4ext/widgets/multiSelect.js"></script>
<!-- <script type="text/javascript" src="common/dwrService.js"></script>-->
<script type="text/javascript" src="i18n/common-${lang}.js"></script>
<script type="text/javascript" src="i18n/system-${lang}.js"></script>
<script type="text/javascript" src="i18n/cmc-${lang}.js"></script>
<script type="text/javascript" src="i18n/ext-lang-${lang}.js"></script>

<script type="text/javascript" src="scripts/debug/widgets/gfa4ext/widgets/gfa4ext-all.js"></script>
<script type="text/javascript" src="scripts/debug/widgets/gfa4ext/widgets/gfa4ext-all-patch.js"></script>
<script type="text/javascript" src="scripts/debug/widgets/gfa4ext/widgets/quickSearchField.js"></script>
<script type="text/javascript" src="scripts/debug/widgets/gfa4ext/widgets/checkColumn.js"></script>

<script type="text/javascript" id="MainFrame"></script> 

<script type="text/javascript">
LoginService.getUserDetail(function(data){
	Gfa.UserDetailHelper.processUserDetail(data);
	document.getElementById("MainFrame").src = "scripts/debug/widgets/gfa4ext/widgets/mainFrame.js";
});
function logout() {
	LoginService.logOut(function(data){});
	window.location="login.jsp";
}
function setLangEn() {
	LoginService.setLangEn(function(){
	    window.location.reload(force=true);
	});
	
}

function setLangCnS() {
	LoginService.setLangCnS(function(){
	    window.location.reload(force=true);
	});
}
function changeLanguage(obj) {
	var vLang = obj.value;
	if(vLang == 'en'){
		setLangEn();
	}else if(vLang == 'zh_CN'){
		setLangCnS();
	}
}
</script>

<style type="text/css">
#main{width:100%;height:100%}
#header{
	background: url(scripts/debug/widgets/ext-2.2.1/resources/images/top_bg.jpg);
	height: 73px;
	position: relative;
}
#footer{
	font-size: 12px;
	text-align: center;
	padding-top: 4px;
	vertical-align: middle;
	width:100%;
	height:50px;
	background:url(scripts/debug/widgets/ext-2.2.1/resources/images/last_bg.gif);
}
.logo {
	float:left;

}
.welcome {
	float:right;
	padding-top:10px;
}
.logout_button {
	cursor:pointer;
	padding-right:30px;
	padding-top:10px;
}
</style>
</head>
<body>
<div id="header">
	<div class="logo"><img src="scripts/debug/widgets/ext-2.2.1/resources/images/logo_admin.jpg" width="256" height="73"/></div>
	<div style="float:right;width:50%;">
		<table align="right">
			<tr>
			<td>
				<div class="welcome">
					<span style="color:#000000;font-size:14px;font-weight:bold;">Welcome</span>
					<span style="color:#FF0000;font-size:14px;font-weight:bold;"><%=userName%></span>
					<span style="padding-right:10px;">
						<SELECT id="userLanguage" style="width:100px;border:0px;margin:-1px;" onchange="changeLanguage(this)"> 
						  <OPTION value="0">选择语言</OPTION> 
						  <OPTION value="en" onclick="javascript:setLangEn();">English</OPTION> 
						  <OPTION value="zh_CN" onclick="javascript:setLangCnS;">简体中文</OPTION>
						 </SELECT>
					</span>
				</div>
			</td>
			</tr>
			<tr>
				<td align="right">
					<div class="logout_button">
						<a href="index.jsp" style="font-size:12px;">返回首页</a>
						<img src="scripts/debug/widgets/ext-2.2.1/resources/images/SignOut.jpg" onclick="logout()">
					</div>
				</td>
			</tr>
		</table>
	</div>
</div>
<div id="footer">
地址：厦门火炬高新区软件园二期望海路29号吉联大厦<br />
邮编：361008  电话：0592-2577999  传真：0592-2577998<br />
CopyRight &copy; 2003-2008 Gillion Technologies Ltd. All Rights Reserved
</div>
</body>
<% } else { %>
<script>
alert("对不起，您的权限不足！请重新登陆！")
window.location = 'login.jsp';
</script>
<% } %>
</html>